<script setup>
import UploadFile from '../../components/upload/DragUploadFile.vue';
import { ElMessage, ElMessageBox } from 'element-plus'
import router from '../../route';
import store from '../../store';

function onSuccess(res){    
    if (res.status == 200){
        store.state.router.data = res.data
        setTimeout(()=> {
            ElMessageBox.close()
            router.push('show') // 如何使用push进行页面传参数
        },1000)
        ElMessageBox.confirm('上传成功','',{
            confirmButtonText: '自动跳转',
            showCancelButton: false,
            type: 'success'
        })
    }
    else{
        ElMessageBox.confirm('上传失败','',{
            confirmButtonText: '确定',
            showCancelButton: false,
            type: 'error'
        })
    }
}

</script>


<template>
  <router-view>
    <UploadFile @success="onSuccess"></UploadFile>
  </router-view>
</template>



<style>

</style>